import request from '@/utils/request';

let mouldName = 'whitelists';
export default {
  getPage(params) {
    return request({
      url: `/${mouldName}/page`,
      method: 'get',
      params
    });
  },
  get(id) {
    return request({
      url: `/${mouldName}/${id}`,
      method: 'get'
    });
  },
  update(data) {
    return request({
      url: `/${mouldName}`,
      method: 'put',
      data
    });
  },
  add(data) {
    return request({
      url: `/${mouldName}`,
      method: 'post',
      data
    });
  },
  delete(data) {
    return request({
      url: `/${mouldName}`,
      method: 'delete',
      data
    });
  },
  writeToFile(filePath) {
    return request({
      url: `/${mouldName}/writeToFile`,
      method: 'get',
      params: {
        filePath
      }
    });
  }
};

